package com.im;

import java.util.ArrayList;

public class SimpleDotCom {
	private ArrayList<String> locationCells;
	//int[] locationCells;
	//int numOfHits = 0;
	
	public void setLocationCells(ArrayList<String> locs) {
		locationCells = locs;
	}
	
	public String checkYourself(String userInput) {
		String result = "miss";
		//int guess = Integer.parseInt(stringGuess);
		int index = locationCells.indexOf(userInput);
		
		/*for (int i = 0; i < locationCells.length; i++) {
			if (guess == locationCells[i]) {
				result = "hit";
				numOfHits++;
				break;
			}
		}
		
		if (numOfHits==locationCells.length) {
			result = "kill";
		}*/
		if (index >= 0) {
			locationCells.remove(index);
			
			if (locationCells.isEmpty()) {
				result = "kill";
			} else {
				result = "hit";
			}
		}
		
		System.out.println(result);
		
		return result;
	}
}
